home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / c / sc.lha / sc.ged < prev    next >
Encoding:
Text File  |  1997-08-16  |  2.3 KB  |  93 lines

  1. /* 
  2.  * $VER: sc.ged 2.0 (16.08.97)
  3.  * Version V1.0 ©1994 Markus Zahn (Zahn@Uni-Augsburg.DE)
  4.  * Compile current file using SAS/C 6.50
  5.  * Version 2.0 changed by Stefan Steppat (Felix@hof.baynet.de)
  6.  * for use with GOLDED 4.0 and SAS C V6.5x
  7.  *
  8.  * Note:
  9.  *
  10.  * Be careful with the AUTOEDIT option in env:sc/SCMSG, i.e. don't
  11.  * use it. The GoldED GUI only gets unlocked, when you close the
  12.  * compiler output window. Use the scmsg.ged script to retrieve your
  13.  * errors/warnings instead!
  14.  */
  15.  
  16.  
  17. OPTIONS RESULTS                             /* enable return codes     */
  18.  
  19. arg doComment                               /* set to TRUE for header  */
  20.  
  21. OPTIONS RESULTS                             /* enable return codes     */
  22.  
  23. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  24.     address 'GOLDED.1'
  25.  
  26. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  27.  
  28. if (RC ~= 0) then
  29.     exit
  30.  
  31. OPTIONS FAILAT 6                            /* ignore warnings         */
  32.  
  33. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  34.  
  35.  
  36. /* ------------------------- INSERT YOUR CODE HERE: ------------------ */
  37.  
  38. 'QUERY CAT'
  39. isGerman = (result = "deutsch")
  40.  
  41. 'QUERY MODIFY'
  42. if( result = 'TRUE' ) then
  43. do
  44.   if( isGerman ) then
  45.     'REQUEST BODY="Datei wurde verändert. Speichern?" BUTTON="Speichern|Abbrechen"'
  46.   else
  47.     'REQUEST BODY="File has been changed. Save it?" BUTTON="SAVE|CANCEL"'
  48.  
  49.   if( result = 1 ) then
  50.     'SAVE ALL'
  51. end
  52.  
  53. 'QUERY ANYTEXT' /* any text loaded? */
  54. if( result = 'TRUE' ) then
  55. do
  56.   'QUERY FILE VAR FILENAME' /* get current filename */
  57.   'QUERY PATH VAR PATH' /* get path of current file */
  58.  
  59.   shell /* address shell */
  60.  
  61.   dir = pragma( 'directory', path ) /* goto directory of current file */
  62.   'sc:c/sc ' || filename /* compile current file */
  63.   path = pragma( 'directory', dir ) /* go back to original directory */
  64.   say
  65.  
  66.   shell /* address host (GoldED) */
  67.  
  68.   if( isGerman ) then
  69.     say "Bitte das Closewindow Gadget drücken"
  70.   else
  71.     say "Done (press the close gadget)."
  72.   pull dummy
  73. end
  74. else
  75. do
  76.   if( isGerman ) then
  77.     'REQUEST BODY="Kein Text vorhanden!?"'
  78.   else
  79.     'REQUEST BODY="Text buffer is empty!?"'
  80. end
  81.  
  82. /* ---------------------------- END OF YOUR CODE ----------------------- */
  83.  
  84. 'UNLOCK' /* VERY important: unlock GUI */
  85. EXIT
  86.  
  87. SYNTAX:
  88.  
  89. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  90. 'UNLOCK'
  91. EXIT
  92.  
  93.